-- Table: public.share

-- DROP TABLE IF EXISTS public.share;

CREATE TABLE IF NOT EXISTS public.share
(
    isin character varying(12) COLLATE pg_catalog."default" NOT NULL,
    figi character varying(12) COLLATE pg_catalog."default" NOT NULL,
    ticker character varying(5) COLLATE pg_catalog."default" NOT NULL,
    class_code character varying(5) COLLATE pg_catalog."default" NOT NULL,
    lot integer NOT NULL DEFAULT 0,
    name character varying(255) COLLATE pg_catalog."default",
    currency character varying(3) COLLATE pg_catalog."default" NOT NULL,
    exchange character varying(32) COLLATE pg_catalog."default" NOT NULL,
    sector character varying(32) COLLATE pg_catalog."default" NOT NULL,
    api_trade_available_flag boolean NOT NULL,
    for_qual_investor_flag boolean NOT NULL,
    nominal_nano integer NOT NULL,
    buy_available_flag boolean NOT NULL,
    sell_available_flag boolean NOT NULL,
    min_price_increment_unit bigint NOT NULL,
    nominal_unit bigint NOT NULL,
    min_price_increment_nano integer NOT NULL,
    first_1min_candle_date timestamp without time zone NOT NULL,
    first_1day_candle_date timestamp without time zone NOT NULL,
    weekend_flag boolean NOT NULL,
    liquidity_flag boolean NOT NULL
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.share
    OWNER to postgres;

GRANT ALL ON TABLE public.share TO loader;

GRANT ALL ON TABLE public.share TO postgres;

COMMENT ON TABLE public.share
    IS 'Описание инструментов акций.';